<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件冒泡和默认行为</title>
    <script src="js/vue.js"></script>
    <script>
        window.onload = function() {
            new Vue({
                el: '#itany',
                methods: {
                    show() {
                        console.log("111");
                    },
                    print() {
                        console.log("222");
                    },
                    write () {
                        console.log("333");
                    },
                    study(e) {
                       console.log("444");
                       e.preventDefault();
                    }
                }
            });
        }
    </script>
</head>
<body>
    <div id="itany">
        <div @click="write">
            <p @click="print">
                <button @click.stop="show">点我</button>
            </p>
        </div>
        <hr/>
        <!--
        <a href="#" @click="study($event)">我是链接</a>
        -->
        <a href="#" @click.prevent="study">我是链接</a>
    </div>
</body>
</html>